package com.clay.appointment.exception;

/**
 * 异常状态枚举
 *
 * @author Yeung Wah
 * @since 2021/5/5
 */
public enum ExceptionEnum {
    /**
     * 异常枚举
     * <p>
     * 503 为通用未定义异常
     */
    PARAMETER_ERROR(501, "非法参数异常"),
    UNDEFINED(503, "未知异常"),
    AUTH_FAILED(504, "鉴权失败"),
    SUCCESS(0, "成功"),
    FAIL(-1, "失败"),
    LOGIN_ERROR(1000, "用户名或密码错误"),
    UNKNOWN_ERROR(2000, "未知错误"),
    PARAMETER_ILLEGAL(2001, "参数不合法"),
    TOKEN_INVALID(2002, "无效的Token"),
    TOKEN_EXPIRED(2004, "token已过期"),
    TOKEN_MISSION(2005, "token缺失"),
    IP_DIFFERENT(2007,"ip不相符");
    private Integer code;
    private String message;


    ExceptionEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}